/*
 * PositionBO.java
 *
 * Created on March 8, 2007, 10:15 PM
 *
 */

package edu.byu.isys413.group1E.data;

/** Stores information about a Position.
 *
 * @author Travis Kulbeth
 */
public class PositionBO {
    private String positionID; 
    private String title;
    private double salary;
    boolean alreadyInDB;
    boolean isDirty;
    
    /** Creates a new instance of PositionBO */
    public PositionBO() {
    }
    
    /** Creates a new instance of PositionBO 
     * @param id contains Position ID (unique GUID)
     */
    public PositionBO(String id) {
        this.setPositionID(id);
        this.setIsDirty(true);
    }

    /** Returns the Position ID
     *@return positionID
     */
    public String getPositionID() {
        return this.positionID;
    }

    /** Sets the Position ID
     *@param positionID contains id for this position object     
     */
    public void setPositionID(String positionID) {
        setIsDirty(true);
        this.positionID = positionID;
    }

    /** Returns the Position Title
     *@return title
     */
    public String getTitle(){
        return this.title;
    }
    
    /** Sets the position Title
     *@param title contains the title for this position
     */
    public void setTitle(String title){
        this.setIsDirty(true);
        this.title = title;
    }

    /** Returns the position Salary
     *@return salary
     */
    public double getSalary(){
        return this.salary;
    }
    
    /** Sets the position salary
     *@param salary contains this position's salary amount
     */
    public void setSalary(double salary){
        this.setIsDirty(true);
        this.salary = salary;
    }    
    /** Sets the alreadyInDB variable to indicate that 
     * the information contained in this object has been stored in the database
     *@param is indicates whether the object been saved to the DB already or not
     */
    public void setAlreadyInDB(boolean is){
        setIsDirty(true);
        this.alreadyInDB = is;
    }

    /** Returns if the information contained in this object has already been stored in the database
     *@return alreadyInDB
     */
    public boolean isAlreadyInDB() {
        return alreadyInDB;
    }

    /** Returns if information has been changed within this object
     *@return if information has changed
     */
    public boolean isIsDirty() {
        return isDirty;
    }

    /** Sets the variable isDirty to indicate that some information has been modified or changed
     *in this object
     *@param isDirty indicates that data has changed
     */
    public void setIsDirty(boolean isDirty) {
        this.isDirty = isDirty;
    }    
}
